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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.w: G = None
        self.y: G = None
        self.txt = txt

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

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

b.v = h
b.x = h
b.o = h
b.y = h
h.p = d
h.t = k
d.w = h
i.z = h
l.o = c
l.p = h
l.t = k
l.y = d
l.v = d
k.p = e
k.w = e
k.y = e
k.x = b
e.u = c
e.r = d
c.o = l
c.p = h
c.t = k
c.y = d
c.v = d
assert h.p.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.o: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.w: G = None
        self.y: G = None
        self.txt = txt

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

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

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