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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.q: E = None
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.r: C = None
        self.z: B = None
        self.v: C = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

l = A("l")
m = B("m")
d = C("d")
j = D("j")
h = E("h")
n = F("n")
b = G("b")

l.o = b
l.t = n
l.w = n
m.x = d
m.u = d
m.q = h
m.s = h
m.w = j
d.o = j
j.y = m
h.r = m
h.v = b
h.s = d
n.r = j
n.w = j
n.x = m
b.u = h
b.t = l
b.r = d
b.v = d
b.x = d
b.z = m
b.s = m
assert b.r.o.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: F = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.q: E = None
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.r: C = None
        self.z: B = None
        self.v: C = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

l = A("l")
m = B("m")
d = C("d")
j = D("j")
h = E("h")
n = F("n")
b = G("b")

l.o = b
l.t = n
l.w = n
m.x = d
m.u = d
m.q = h
m.s = h
m.w = j
d.o = j
j.y = m
h.r = m
h.v = b
h.s = d
n.r = j
n.w = j
n.x = m
b.u = h
b.t = l
b.r = d
b.v = d
b.x = d
b.z = m
b.s = m
assert b.r.o.y.q.txt == "h"