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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.t: G = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.t: G = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

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

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