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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.v: G = None
        self.x: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.y: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.v: G = None
        self.x: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.y: E = None
        self.txt = txt

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

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

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