class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: G = None
        self.z: C = None
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.w: C = None
        self.p: F = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
b = C("b")
k = D("k")
e = E("e")
a = F("a")
m = G("m")
l = B("l")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.w: C = None
        self.p: F = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
b = C("b")
k = D("k")
e = E("e")
a = F("a")
m = G("m")
l = B("l")

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