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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.p: B = None
        self.v: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.p: B = None
        self.v: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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