class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.p: F = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
c = C("c")
g = D("g")
k = E("k")
l = F("l")
e = G("e")

b.z = k
b.t = e
b.p = l
b.v = f
b.x = f
f.v = e
f.y = e
f.o = c
c.r = k
g.y = l
g.p = l
k.y = b
l.v = g
l.z = b
e.x = g
assert b.z.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.p: F = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
c = C("c")
g = D("g")
k = E("k")
l = F("l")
e = G("e")

b.z = k
b.t = e
b.p = l
b.v = f
b.x = f
f.v = e
f.y = e
f.o = c
c.r = k
g.y = l
g.p = l
k.y = b
l.v = g
l.z = b
e.x = g
assert b.z.y.z.y.txt == "b"