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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.r: F = None
        self.o: F = None
        self.x: E = None
        self.v: F = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.w: D = None
        self.t: E = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

f = A("f")
n = B("n")
h = C("h")
e = D("e")
j = E("j")
k = F("k")
b = G("b")

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.r: F = None
        self.o: F = None
        self.x: E = None
        self.v: F = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.w: D = None
        self.t: E = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

f = A("f")
n = B("n")
h = C("h")
e = D("e")
j = E("j")
k = F("k")
b = G("b")

f.v = e
f.x = n
f.y = n
n.u = e
h.t = k
h.r = k
h.o = k
h.v = k
h.y = e
h.x = j
h.z = j
e.p = h
e.v = n
j.r = e
k.q = n
k.z = n
k.y = h
k.v = j
b.o = n
b.z = e
b.w = e
b.r = e
b.t = j
b.p = j
assert j.r.p.y.p.txt == "h"