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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: F = None
        self.p: D = None
        self.s: G = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: F = None
        self.p: D = None
        self.s: G = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.txt = txt

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

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