class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.u: G = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

a.w = d
a.u = d
a.y = g
a.s = j
j.p = m
j.x = m
j.o = l
l.z = g
l.s = m
l.w = a
c.t = d
c.r = a
c.z = h
c.x = m
c.y = m
c.v = l
m.o = a
m.r = a
g.r = l
d.z = m
h.p = m
h.x = m
h.o = l
assert h.x.o.y.txt == "g"