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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.q: A = None
        self.u: D = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

i = A("i")
g = B("g")
c = C("c")
e = D("e")
j = E("j")
h = F("h")

i.q = j
i.s = h
g.x = h
g.z = e
g.r = e
c.x = g
c.z = i
c.u = e
e.v = c
e.y = c
e.s = i
j.z = c
j.x = i
j.q = i
j.u = e
j.o = e
j.r = e
h.v = j
assert i.q.u.s.s.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.q: A = None
        self.u: D = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

i = A("i")
g = B("g")
c = C("c")
e = D("e")
j = E("j")
h = F("h")

i.q = j
i.s = h
g.x = h
g.z = e
g.r = e
c.x = g
c.z = i
c.u = e
e.v = c
e.y = c
e.s = i
j.z = c
j.x = i
j.q = i
j.u = e
j.o = e
j.r = e
h.v = j
assert i.q.u.s.s.v.x.txt == "i"