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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.u: H = None
        self.q: E = None
        self.p: C = None
        self.y: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.r: F = None
        self.q: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: B = None
        self.p: B = None
        self.y: C = None
        self.z: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.z: E = None
        self.u: F = None
        self.o: A = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.u: H = None
        self.q: E = None
        self.p: C = None
        self.y: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.r: F = None
        self.q: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: B = None
        self.p: B = None
        self.y: C = None
        self.z: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.z: E = None
        self.u: F = None
        self.o: A = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.z: G = None
        self.txt = txt

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

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