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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.v: B = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.z: A = None
        self.q: F = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

f = A("f")
k = B("k")
b = C("b")
d = D("d")
j = E("j")
n = F("n")
h = F("h")
c = B("c")
l = D("l")
m = B("m")

f.t = j
f.z = j
f.y = d
f.x = k
k.r = n
k.y = c
b.y = j
b.x = m
b.r = f
d.w = f
d.t = f
d.u = f
d.y = k
d.v = c
j.z = f
j.u = f
j.s = h
n.x = h
n.w = h
n.q = h
n.z = f
n.t = f
n.y = m
h.x = n
h.w = n
h.q = n
h.z = f
h.t = f
h.y = c
c.r = h
c.y = k
l.w = f
l.t = f
l.u = f
l.y = m
l.v = m
m.r = h
m.y = k
assert n.x.y.y.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.z: E = None
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.v: B = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.z: A = None
        self.q: F = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

f = A("f")
k = B("k")
b = C("b")
d = D("d")
j = E("j")
n = F("n")
h = F("h")
c = B("c")
l = D("l")
m = B("m")

f.t = j
f.z = j
f.y = d
f.x = k
k.r = n
k.y = c
b.y = j
b.x = m
b.r = f
d.w = f
d.t = f
d.u = f
d.y = k
d.v = c
j.z = f
j.u = f
j.s = h
n.x = h
n.w = h
n.q = h
n.z = f
n.t = f
n.y = m
h.x = n
h.w = n
h.q = n
h.z = f
h.t = f
h.y = c
c.r = h
c.y = k
l.w = f
l.t = f
l.u = f
l.y = m
l.v = m
m.r = h
m.y = k
assert n.x.y.y.y.r.txt == "h"