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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: F = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.u: A = None
        self.x: F = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

h = A("h")
n = B("n")
b = C("b")
e = D("e")
a = E("a")
g = F("g")

h.v = n
h.r = n
h.w = n
h.t = g
h.p = a
h.y = a
n.t = a
b.v = g
b.r = g
b.p = a
b.q = e
e.s = h
e.y = h
e.u = h
e.x = g
e.q = g
e.o = b
a.z = g
a.q = b
a.t = n
g.x = b
assert a.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.p: E = None
        self.r: B = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: F = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.u: A = None
        self.x: F = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

h = A("h")
n = B("n")
b = C("b")
e = D("e")
a = E("a")
g = F("g")

h.v = n
h.r = n
h.w = n
h.t = g
h.p = a
h.y = a
n.t = a
b.v = g
b.r = g
b.p = a
b.q = e
e.s = h
e.y = h
e.u = h
e.x = g
e.q = g
e.o = b
a.z = g
a.q = b
a.t = n
g.x = b
assert a.t.t.q.txt == "b"