class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: D = None
        self.w: B = None
        self.q: E = None
        self.t: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.o: E = None
        self.y: F = None
        self.q: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.x: C = None
        self.t: A = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

c = A("c")
j = B("j")
g = C("g")
l = D("l")
n = E("n")
m = F("m")

c.y = m
c.z = l
c.t = l
c.p = l
c.w = j
c.q = n
j.v = l
g.q = c
g.z = n
g.w = n
l.t = m
l.y = m
l.v = c
l.o = n
l.q = n
l.x = j
n.u = c
n.q = l
n.x = m
m.o = c
m.t = c
m.w = c
m.y = j
m.u = j
m.x = g
assert n.x.w.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: D = None
        self.w: B = None
        self.q: E = None
        self.t: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.o: E = None
        self.y: F = None
        self.q: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.x: C = None
        self.t: A = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

c = A("c")
j = B("j")
g = C("g")
l = D("l")
n = E("n")
m = F("m")

c.y = m
c.z = l
c.t = l
c.p = l
c.w = j
c.q = n
j.v = l
g.q = c
g.z = n
g.w = n
l.t = m
l.y = m
l.v = c
l.o = n
l.q = n
l.x = j
n.u = c
n.q = l
n.x = m
m.o = c
m.t = c
m.w = c
m.y = j
m.u = j
m.x = g
assert n.x.w.p.q.u.txt == "c"