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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.v: B = None
        self.t: F = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

j = A("j")
h = B("h")
c = C("c")
b = D("b")
l = E("l")
i = F("i")
n = E("n")
a = D("a")
f = F("f")
g = A("g")

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.v: B = None
        self.t: F = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

j = A("j")
h = B("h")
c = C("c")
b = D("b")
l = E("l")
i = F("i")
n = E("n")
a = D("a")
f = F("f")
g = A("g")

j.y = n
j.z = h
j.x = h
j.r = f
h.x = c
c.o = h
c.s = h
c.v = h
c.t = f
c.u = l
b.u = g
b.v = h
b.r = c
l.z = c
l.q = h
l.t = b
i.z = a
i.o = h
i.x = f
n.z = c
n.q = h
n.t = a
a.u = g
a.v = h
a.r = c
f.z = a
f.o = h
f.x = i
g.y = n
g.z = h
g.x = h
g.r = i
assert a.r.t.o.x.txt == "c"