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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
e = C("e")
b = D("b")
a = E("a")
d = F("d")
f = C("f")
c = C("c")

g.s = f
l.y = g
l.s = g
l.o = f
l.p = a
e.q = l
e.v = f
e.w = a
e.u = g
b.s = a
b.r = c
a.r = d
a.q = d
a.v = e
a.t = f
a.p = c
a.y = l
d.o = l
d.y = b
f.q = l
f.v = e
f.w = a
f.u = g
c.q = l
c.v = f
c.w = a
c.u = g
assert a.t.q.p.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
e = C("e")
b = D("b")
a = E("a")
d = F("d")
f = C("f")
c = C("c")

g.s = f
l.y = g
l.s = g
l.o = f
l.p = a
e.q = l
e.v = f
e.w = a
e.u = g
b.s = a
b.r = c
a.r = d
a.q = d
a.v = e
a.t = f
a.p = c
a.y = l
d.o = l
d.y = b
f.q = l
f.v = e
f.w = a
f.u = g
c.q = l
c.v = f
c.w = a
c.u = g
assert a.t.q.p.v.u.txt == "g"