class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.x: E = None
        self.p: F = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.x: A = None
        self.w: E = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.x: A = None
        self.w: E = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

g.t = d
g.p = d
g.y = i
g.x = a
g.s = b
g.q = c
m.u = g
c.v = a
c.p = a
c.w = a
c.o = a
c.r = a
c.x = b
i.v = d
a.t = i
a.y = i
a.z = g
d.r = b
d.v = b
d.y = m
d.q = m
d.x = a
b.t = d
b.p = d
b.y = i
b.x = a
b.s = g
b.q = c
assert g.p.x.z.txt == "g"