class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: D = None
        self.t: D = None
        self.z: B = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
m = C("m")
h = D("h")
d = E("d")
j = F("j")
f = C("f")
a = B("a")

l.r = f
l.q = f
l.s = h
l.t = h
l.w = h
l.z = i
i.x = a
i.u = j
i.w = j
i.v = j
i.p = h
m.u = i
m.v = i
m.x = j
h.u = d
d.x = f
d.z = f
d.p = j
d.t = l
d.q = i
d.r = a
j.p = f
j.x = i
f.u = a
f.v = a
f.x = j
a.x = i
a.u = j
a.w = j
a.v = j
a.p = h
assert m.u.p.u.r.x.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: D = None
        self.t: D = None
        self.z: B = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
m = C("m")
h = D("h")
d = E("d")
j = F("j")
f = C("f")
a = B("a")

l.r = f
l.q = f
l.s = h
l.t = h
l.w = h
l.z = i
i.x = a
i.u = j
i.w = j
i.v = j
i.p = h
m.u = i
m.v = i
m.x = j
h.u = d
d.x = f
d.z = f
d.p = j
d.t = l
d.q = i
d.r = a
j.p = f
j.x = i
f.u = a
f.v = a
f.x = j
a.x = i
a.u = j
a.w = j
a.v = j
a.p = h
assert m.u.p.u.r.x.x.u.x.txt == "i"