class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.t: G = None
        self.y: B = None
        self.p: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

d = A("d")
e = B("e")
h = C("h")
c = D("c")
b = E("b")
j = F("j")
m = G("m")
l = C("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.t: G = None
        self.y: B = None
        self.p: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

d = A("d")
e = B("e")
h = C("h")
c = D("c")
b = E("b")
j = F("j")
m = G("m")
l = C("l")

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