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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.p: C = None
        self.z: A = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
j = C("j")
n = D("n")
e = E("e")
a = F("a")
m = C("m")
c = B("c")
b = E("b")

g.y = n
g.x = a
d.u = c
d.r = j
j.o = n
j.t = e
j.p = m
j.z = g
n.x = d
e.v = a
e.s = a
e.x = a
e.r = n
a.t = b
a.x = b
a.v = g
a.y = g
a.o = d
m.o = n
m.t = b
m.p = j
m.z = g
c.u = d
c.r = j
b.v = a
b.s = a
b.x = a
b.r = n
assert a.t.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.p: C = None
        self.z: A = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
j = C("j")
n = D("n")
e = E("e")
a = F("a")
m = C("m")
c = B("c")
b = E("b")

g.y = n
g.x = a
d.u = c
d.r = j
j.o = n
j.t = e
j.p = m
j.z = g
n.x = d
e.v = a
e.s = a
e.x = a
e.r = n
a.t = b
a.x = b
a.v = g
a.y = g
a.o = d
m.o = n
m.t = b
m.p = j
m.z = g
c.u = d
c.r = j
b.v = a
b.s = a
b.x = a
b.r = n
assert a.t.x.x.x.txt == "a"