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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: E = None
        self.u: H = None
        self.t: E = None
        self.r: E = None
        self.w: D = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
d = D("d")
l = E("l")
h = F("h")
n = G("n")
c = H("c")
j = D("j")
e = B("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: E = None
        self.u: H = None
        self.t: E = None
        self.r: E = None
        self.w: D = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
d = D("d")
l = E("l")
h = F("h")
n = G("n")
c = H("c")
j = D("j")
e = B("e")

f.r = l
b.y = f
a.u = h
a.x = h
a.v = l
a.y = c
a.q = d
a.t = d
a.p = j
d.x = n
d.w = j
l.w = h
l.v = c
l.q = a
h.r = n
n.z = c
n.u = c
n.x = c
n.y = l
n.t = l
n.r = l
n.w = d
c.z = h
j.x = n
j.w = d
e.y = f
assert j.x.u.z.r.x.z.r.txt == "n"